updated documentation slightly
This commit is contained in:
		| @ -91,7 +91,7 @@ oops: | |||||||
| @endcode | @endcode | ||||||
|  |  | ||||||
| Things can get simpler when you use C++ API. Note that the C++ API supports  | Things can get simpler when you use C++ API. Note that the C++ API supports  | ||||||
| just a single runtime context for each interpreter. | 1 single runtime context for each interpreter. | ||||||
|  |  | ||||||
| @code | @code | ||||||
| /* c++ -o hello hello.cpp -lqseawkxx -lqseawk -lqsecmnxx -lqsecmn -lm */ | /* c++ -o hello hello.cpp -lqseawkxx -lqseawk -lqsecmnxx -lqsecmn -lm */ | ||||||
|  | |||||||
| @ -65,8 +65,8 @@ qse_fma_fini() invalidates all the pointers allocated with qse_fma_alloc(). | |||||||
| qse_fma_t* fma; int* ptr; | qse_fma_t* fma; int* ptr; | ||||||
| fma = qse_fma_open (QSE_NULL, 0, sizeof(int), 10, 0); // create an allocator  | fma = qse_fma_open (QSE_NULL, 0, sizeof(int), 10, 0); // create an allocator  | ||||||
| ptr = (int*)qse_fma_alloc (fma, sizeof(int)); // allocate a block | ptr = (int*)qse_fma_alloc (fma, sizeof(int)); // allocate a block | ||||||
| ptr = 20; // access the block | *ptr = 20; // access the block | ||||||
| qse_fma_free (fma, ptr1); // free the block | qse_fma_free (fma, ptr); // free the block | ||||||
| qse_fma_close (fma); // destroy the allocator | qse_fma_close (fma); // destroy the allocator | ||||||
| @endcode | @endcode | ||||||
|  |  | ||||||
| @ -75,4 +75,12 @@ qse_fma_close (fma); // destroy the allocator | |||||||
| If you want to allocate blocks quickly but don't want to resize or  | If you want to allocate blocks quickly but don't want to resize or  | ||||||
| deallocate the blocks individually, you can use #qse_pma_t. | deallocate the blocks individually, you can use #qse_pma_t. | ||||||
|  |  | ||||||
|  | @code | ||||||
|  | qse_pma_t* pma; int* ptr; | ||||||
|  | pma = qse_pma_open (QSE_NULL, 0); // create an allocator  | ||||||
|  | ptr = (int*)qse_pma_alloc (pma, sizeof(int)); // allocate a block | ||||||
|  | *ptr = 20; // access the block | ||||||
|  | qse_pma_close (pma); // destroy the allocator | ||||||
|  | @endcode | ||||||
|  |  | ||||||
| */ | */ | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user