diff --git a/qse/doc/page/awk.doc b/qse/doc/page/awk.doc index 4215e957..e7c097c1 100644 --- a/qse/doc/page/awk.doc +++ b/qse/doc/page/awk.doc @@ -91,7 +91,7 @@ oops: @endcode 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 /* c++ -o hello hello.cpp -lqseawkxx -lqseawk -lqsecmnxx -lqsecmn -lm */ diff --git a/qse/doc/page/mem.doc b/qse/doc/page/mem.doc index d641fa78..cbd23de3 100644 --- a/qse/doc/page/mem.doc +++ b/qse/doc/page/mem.doc @@ -65,8 +65,8 @@ qse_fma_fini() invalidates all the pointers allocated with qse_fma_alloc(). qse_fma_t* fma; int* ptr; 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 = 20; // access the block -qse_fma_free (fma, ptr1); // free the block +*ptr = 20; // access the block +qse_fma_free (fma, ptr); // free the block qse_fma_close (fma); // destroy the allocator @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 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 + */