Fix totally wrong formula.
authorRobert Haas <rhaas@postgresql.org>
Thu, 5 Jun 2014 20:55:56 +0000 (16:55 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 5 Jun 2014 20:55:56 +0000 (16:55 -0400)
src/include/utils/freepage.h

index dd905d72b7efe2beb6b8569848a43a19f80a45fd..0cd2820441e2914b47c4a03984efce69d2483dbc 100644 (file)
@@ -71,7 +71,7 @@ struct FreePageManager
 
 /* Macro to convert an allocation size to a number of pages. */
 #define fpm_size_to_pages(sz) \
-       (TYPEALIGN((sz), FPM_PAGE_SIZE))
+       (((sz) + FPM_PAGE_SIZE - 1) / FPM_PAGE_SIZE)
 
 /* Macros to check alignment of absolute and relative pointers. */
 #define fpm_pointer_is_page_aligned(base, ptr)         \