Docs: fix formatting of two examples, improve grammar (#37)

This commit is contained in:
Eli Boyarski
2020-12-02 19:25:01 +02:00
committed by GitHub
parent 0754642bba
commit 810cc7650a
+5 -3
View File
@@ -192,13 +192,13 @@ Pool interfaces will always prefer to `return 0` instead of throwing an exceptio
[h5 Ordered versus unordered]
An ordered pool maintains it's free list in order of the address of each free block -
An ordered pool maintains its free list in order of the address of each free block -
this is the most efficient way if you're likely to allocate arrays of objects.
However, freeing an object can be O(N) in the number of currently free blocks which
can be prohibitively expensive in some situations.
An unordered pool does not maintain it's free list in any particular order, as a result
allocation and freeing single objects is very fast, but allocating arrays may be slow
An unordered pool does not maintain its free list in any particular order, as a result
allocating and freeing single objects is very fast, but allocating arrays may be slow
(and in particular the pool may not be aware that it contains enough free memory for the
allocation request, and unnecessarily allocate more memory).
@@ -351,6 +351,7 @@ Defines the method that the underlying Pool will use to allocate memory from the
Default is default_user_allocator_new_delete. See ____UserAllocator for details.
[*Example:]
struct X { ... }; // has destructor with side-effects.
void func()
@@ -437,6 +438,7 @@ Must be greater than 0.
Defines the method that the underlying pool will use to allocate memory from the system. See User Allocators for details.
[*Example:]
struct MyPoolTag { };
typedef boost::singleton_pool<MyPoolTag, sizeof(int)> my_pool;