From c71eb6f1bd2a320c4b458d60deda9f4f4063904a Mon Sep 17 00:00:00 2001 From: Mauricio Fernandez Date: Sun, 16 Aug 2015 16:11:50 +0200 Subject: [PATCH 1/7] Add trivial buffer pool implementation (Ocsigen_buffer_pool). --- src/Makefile.filelist | 1 + src/baselib/.depend | 3 + src/baselib/Makefile | 1 + src/baselib/ocsigen_buffer_pool.ml | 122 ++++++++++++++++++++++++++++ src/baselib/ocsigen_buffer_pool.mli | 87 ++++++++++++++++++++ 5 files changed, 214 insertions(+) create mode 100644 src/baselib/ocsigen_buffer_pool.ml create mode 100644 src/baselib/ocsigen_buffer_pool.mli diff --git a/src/Makefile.filelist b/src/Makefile.filelist index 2d08c2abc..0b010af64 100644 --- a/src/Makefile.filelist +++ b/src/Makefile.filelist @@ -2,6 +2,7 @@ BIN := server/${PROJECTNAME} NATBIN := server/${PROJECTNAME}.opt INTF := baselib/ocsigen_cache.cmi \ + baselib/ocsigen_buffer_pool.cmi \ baselib/ocsigen_lib_base.cmi \ baselib/ocsigen_lib.cmi \ baselib/ocsigen_config.cmi \ diff --git a/src/baselib/.depend b/src/baselib/.depend index 48e2fd617..cd5bd78c3 100644 --- a/src/baselib/.depend +++ b/src/baselib/.depend @@ -1,5 +1,6 @@ ocsigen_loader.cmi : ocsigen_cache.cmi : +ocsigen_buffer_pool.cmi : ocsigen_stream.cmi : ocsigen_config.cmi : ocsigen_lib.cmi ocsigen_messages.cmi : @@ -13,6 +14,8 @@ dynlink_wrapper.nonatdynlink.cmo : dynlink_wrapper.nonatdynlink.cmx : ocsigen_cache.cmo : ocsigen_cache.cmi ocsigen_cache.cmx : ocsigen_cache.cmi +ocsigen_buffer_pool.cmo : ocsigen_buffer_pool.cmi +ocsigen_buffer_pool.cmx : ocsigen_buffer_pool.cmi ocsigen_commandline.cmo : ocsigen_getcommandline.cmi ocsigen_config.cmi ocsigen_commandline.cmx : ocsigen_getcommandline.cmi ocsigen_config.cmx ocsigen_config.cmo : ocsigen_lib.cmi ocsigen_config.cmi diff --git a/src/baselib/Makefile b/src/baselib/Makefile index a6fe6ccf2..f073cd3ea 100644 --- a/src/baselib/Makefile +++ b/src/baselib/Makefile @@ -25,6 +25,7 @@ all: byte opt FILES := ocsigen_lib_base.ml \ ocsigen_lib.ml \ ocsigen_cache.ml \ + ocsigen_buffer_pool.ml \ ocsigen_config.ml \ ocsigen_commandline.ml \ ocsigen_messages.ml \ diff --git a/src/baselib/ocsigen_buffer_pool.ml b/src/baselib/ocsigen_buffer_pool.ml new file mode 100644 index 000000000..aa4afb3fe --- /dev/null +++ b/src/baselib/ocsigen_buffer_pool.ml @@ -0,0 +1,122 @@ +(* Copyright (C) 2015 Mauricio Fernandez + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*) + +module POOL : +sig + type 'a t + + val make : (unit -> 'a) -> int -> 'a t + val take : 'a t -> 'a + val give_back : 'a t -> 'a -> unit +end = +struct + type 'a t = + { + create : unit -> 'a; + q : 'a Stack.t; + capacity : int; + mutable q_size : int; + } + + let make create capacity = + { create; capacity; + q_size = 0; + q = Stack.create (); + } + + let take t = + if Stack.is_empty t.q then + t.create () + else + let x = Stack.pop t.q in + t.q_size <- t.q_size - 1; + x + + let give_back t x = + if t.q_size < t.capacity then begin + Stack.push x t.q; + t.q_size <- t.q_size + 1; + end +end + +let round_to_pow2 n = + let m = ref 1 in + while !m < n do + m := !m * 2; + done; + !m + +let is_pow2 n = + let m = n lor (n lsr 1) in + let m = m lor (m lsr 2) in + let m = m lor (m lsr 4) in + let m = m lor (m lsr 8) in + let m = m lor (m lsr 16) in + n land (m lsr 1) = 0 + +let make_buffer_pool ?(min_size = 64) ?(max_size = 65536) create capacity = + let h = Hashtbl.create 13 in + + let get_pool size = + try + Hashtbl.find h size + with Not_found -> + let p = POOL.make (fun () -> create size) (capacity size) in + Hashtbl.add h size p; + p in + + let get ~exact size = + if (exact && not (is_pow2 size)) || size < min_size || size > max_size then + (create size, (fun () -> ())) + else + let p = get_pool (round_to_pow2 size) in + let x = POOL.take p in + + let released = ref false in + + let release () = + if not !released then begin + released := true; + POOL.give_back p x + end + in + (x, release) + in + (`Round_up (get ~exact:false), `Exact (get ~exact:true)) + +let `Round_up get_bytes, `Exact get_bytes_exact = + make_buffer_pool Bytes.create (fun _ -> 256) + +let `Round_up get_lwt_bytes, `Exact get_lwt_bytes_exact = + make_buffer_pool Lwt_bytes.create (fun _ -> 256) + +let dummy_get_bytes n = (Bytes.create n, (fun () -> ())) +let dummy_get_lwt_bytes n = (Lwt_bytes.create n, (fun () -> ())) + +let get_bytes, get_bytes_exact = + try + ignore (Unix.getenv "OCSIGEN_DISABLE_BUFFER_POOL"); + (dummy_get_bytes, dummy_get_bytes) + with Not_found -> + (get_bytes, get_bytes_exact) + +let get_lwt_bytes, get_lwt_bytes_exact = + try + ignore (Unix.getenv "OCSIGEN_DISABLE_BUFFER_POOL"); + (dummy_get_lwt_bytes, dummy_get_lwt_bytes) + with Not_found -> + (get_lwt_bytes, get_lwt_bytes_exact) diff --git a/src/baselib/ocsigen_buffer_pool.mli b/src/baselib/ocsigen_buffer_pool.mli new file mode 100644 index 000000000..3856f8db9 --- /dev/null +++ b/src/baselib/ocsigen_buffer_pool.mli @@ -0,0 +1,87 @@ +(* Copyright (C) 2015 Mauricio Fernandez + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, with linking exception; + * either version 2.1 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*) + +(** + Buffer pools. + + Not (preemptive) thread safe. + + @author Mauricio Fernandez +*) + +(** [make_buffer_pool ?min_size ?max_size make capacity] + * returns two functions [`Round_up f] and [`Exact g] that are invoked as + * in [f wanted_size] and return a buffer of the wanted size and a function + * to release the buffer and return it to the pool. These functions do not + * block and will return a buffer immediately. + * + * [f] will round up the size to a power of two. [g] will not, and will thus + * allocate fresh buffers if invoked with sizes that are not powers of two. + * + * [make_buffer_pool] is used as follows: + * + * {| + * let `Round_up get_buf, `Exact get_buf_exact = + * make_buffer_pool ?min_size ?max_size allocate_buffer + * (fun n -> how_many_buffers_to_keep_at_most n) + * + * ... + * let b, release = get_buf 4096 in + * ... + * + * release () + * ]} + * + * The release function can be invoked any number of times (the second and + * later calls are NOPs). If not invoked, the buffer will not be returned to + * the pool, but this is usually harmless (it only means there will be more + * allocation later in time). + * + * The returned buffers must not be used after they have been released, as + * they might have been reused at that point. + * + * @param min_size buffers of size under [min_size] are not pooled (and + * always freshly allocated with [make size] (default: 64) + * + * @param max_size buffers of size over [max_size] are not pooled (and + * always freshly allocated with [make size] (default: 65536) + * + * @param capacity is used to compute how many buffers to retain at most (as a + * function of the corresponding size). If [capacity n] returns [m], that + * means that the the pool will hold at most [m] buffers. Note that buffers + * are allocated lazily (only when the pool is empty), and the actual number + * of buffers (of a given size) allocated depends on how many are used + * simultaneously (before being released). + * *) + +val make_buffer_pool : + ?min_size:int -> + ?max_size:int -> + (int -> 'a) -> + (int -> int) -> + [`Round_up of int -> 'a * (unit -> unit) ] * + [`Exact of int -> 'a * (unit -> unit) ] + +(** {2 Buffer allocation against internal Ocsigen pools.} + * + * Pooling can be disabled altogether (for benchmark or other purposes) by + * setting the [OCSIGEN_DISABLE_BUFFER_POOL] environment variable. + * *) +val get_bytes : int -> Bytes.t * (unit -> unit) +val get_bytes_exact : int -> Bytes.t * (unit -> unit) +val get_lwt_bytes : int -> Lwt_bytes.t * (unit -> unit) +val get_lwt_bytes_exact : int -> Lwt_bytes.t * (unit -> unit) From f499fb6e7133b95b9ead2a6a926c11dbb3779b0f Mon Sep 17 00:00:00 2001 From: Mauricio Fernandez Date: Sun, 16 Aug 2015 20:09:14 +0200 Subject: [PATCH 2/7] Use buffer pool in deflatemod. --- src/extensions/.depend | 10 ++++++---- src/extensions/deflatemod.ml | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/extensions/.depend b/src/extensions/.depend index 46d0c062c..d6484d793 100644 --- a/src/extensions/.depend +++ b/src/extensions/.depend @@ -35,12 +35,14 @@ cors.cmx : ../server/ocsigen_request_info.cmx ../baselib/ocsigen_lib.cmx \ ../http/ocsigen_http_frame.cmx ../server/ocsigen_extensions.cmx \ ../http/http_headers.cmx ../http/framepp.cmx deflatemod.cmo : ../baselib/ocsigen_stream.cmi \ - ../server/ocsigen_request_info.cmi ../http/ocsigen_http_frame.cmi \ - ../http/ocsigen_headers.cmi ../server/ocsigen_extensions.cmi \ + ../server/ocsigen_request_info.cmi ../baselib/ocsigen_lib.cmi \ + ../http/ocsigen_http_frame.cmi ../http/ocsigen_headers.cmi \ + ../server/ocsigen_extensions.cmi ../baselib/ocsigen_buffer_pool.cmi \ ../http/http_headers.cmi deflatemod.cmx : ../baselib/ocsigen_stream.cmx \ - ../server/ocsigen_request_info.cmx ../http/ocsigen_http_frame.cmx \ - ../http/ocsigen_headers.cmx ../server/ocsigen_extensions.cmx \ + ../server/ocsigen_request_info.cmx ../baselib/ocsigen_lib.cmx \ + ../http/ocsigen_http_frame.cmx ../http/ocsigen_headers.cmx \ + ../server/ocsigen_extensions.cmx ../baselib/ocsigen_buffer_pool.cmx \ ../http/http_headers.cmx extendconfiguration.cmo : ../server/ocsigen_parseconfig.cmi \ ../server/ocsigen_extensions.cmi ../http/ocsigen_cookies.cmi \ diff --git a/src/extensions/deflatemod.ml b/src/extensions/deflatemod.ml index cfdde388d..b466bab3c 100644 --- a/src/extensions/deflatemod.ml +++ b/src/extensions/deflatemod.ml @@ -149,6 +149,7 @@ and next_cont oz stream = (* deflate param : true = deflate ; false = gzip (no header in this case) *) let compress deflate stream = let zstream = Zlib.deflate_init !compress_level deflate in + let buf, release = Ocsigen_buffer_pool.get_bytes !buffer_size in let finalize status = Ocsigen_stream.finalize stream status >>= fun e -> (try @@ -156,12 +157,13 @@ let compress deflate stream = with (* ignore errors, deflate_end cleans everything anyway *) Zlib.Error _ -> ()); + release (); return (Lwt_log.ign_info ~section "Zlib stream closed") in let oz = { stream = zstream ; - buf = Bytes.create !buffer_size; + buf; pos = 0; - avail = !buffer_size + avail = Bytes.length buf; } in let new_stream () = next_cont oz (Ocsigen_stream.get stream) in Lwt_log.ign_info ~section "Zlib stream initialized" ; From 423285fb54527aad87cdb8ece4ee998715dbb162 Mon Sep 17 00:00:00 2001 From: Mauricio Fernandez Date: Sun, 16 Aug 2015 20:10:29 +0200 Subject: [PATCH 3/7] Use buffer pool in Ocsigen_senders.File_content. --- src/http/.depend | 6 ++++-- src/http/ocsigen_senders.ml | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/http/.depend b/src/http/.depend index c5807311e..9be8b2bcf 100644 --- a/src/http/.depend +++ b/src/http/.depend @@ -51,11 +51,13 @@ ocsigen_http_frame.cmx : ../baselib/ocsigen_stream.cmx \ ocsigen_senders.cmo : ../baselib/ocsigen_stream.cmi \ ../baselib/ocsigen_lib.cmi ocsigen_http_frame.cmi ocsigen_http_com.cmi \ ocsigen_cookies.cmi ../baselib/ocsigen_config.cmi \ - ocsigen_charset_mime.cmi http_headers.cmi ocsigen_senders.cmi + ocsigen_charset_mime.cmi ../baselib/ocsigen_buffer_pool.cmi \ + http_headers.cmi ocsigen_senders.cmi ocsigen_senders.cmx : ../baselib/ocsigen_stream.cmx \ ../baselib/ocsigen_lib.cmx ocsigen_http_frame.cmx ocsigen_http_com.cmx \ ocsigen_cookies.cmx ../baselib/ocsigen_config.cmx \ - ocsigen_charset_mime.cmx http_headers.cmx ocsigen_senders.cmi + ocsigen_charset_mime.cmx ../baselib/ocsigen_buffer_pool.cmx \ + http_headers.cmx ocsigen_senders.cmi test_parser.cmo : ocsigen_http_frame.cmi http_lexer.cmo test_parser.cmx : ocsigen_http_frame.cmx http_lexer.cmx test_pp.cmo : ocsigen_http_frame.cmi framepp.cmi diff --git a/src/http/ocsigen_senders.ml b/src/http/ocsigen_senders.ml index 6a21fdfe9..3d6d8cafe 100644 --- a/src/http/ocsigen_senders.ml +++ b/src/http/ocsigen_senders.ml @@ -229,12 +229,16 @@ struct | Some s -> s in Lwt_log.ign_info ~section "start reading file (file opened)"; - let buf = Bytes.create buffer_size in + let buf, release = Ocsigen_buffer_pool.get_bytes buffer_size in + (* get_bytes might round size up to next power of two *) + let buffer_size = Bytes.length buf in + let rec read_aux () = Lwt_unix.read fd buf 0 buffer_size >>= fun read -> - if read = 0 then + if read = 0 then begin + release (); Ocsigen_stream.empty None - else begin + end else begin if read = buffer_size then Ocsigen_stream.cont buf read_aux else Ocsigen_stream.cont (String.sub buf 0 read) read_aux From 10393df1ec126853cb4b2df3c265528e3f299fdf Mon Sep 17 00:00:00 2001 From: Mauricio Fernandez Date: Sun, 16 Aug 2015 20:11:54 +0200 Subject: [PATCH 4/7] Use buffer pool in Ocsigen_http_com (per-connection/receiver buffers). --- src/http/.depend | 8 ++++---- src/http/ocsigen_http_com.ml | 35 ++++++++++++++++++++++++++++------- src/http/ocsigen_http_com.mli | 1 + src/server/ocsigen_server.ml | 4 +++- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/http/.depend b/src/http/.depend index 9be8b2bcf..29d841f36 100644 --- a/src/http/.depend +++ b/src/http/.depend @@ -36,12 +36,12 @@ ocsigen_headers.cmx : ocsigen_senders.cmx ../baselib/ocsigen_lib.cmx \ ocsigen_headers.cmi ocsigen_http_com.cmo : ../baselib/ocsigen_stream.cmi \ ../baselib/ocsigen_lib.cmi ocsigen_http_frame.cmi ocsigen_cookies.cmi \ - ../baselib/ocsigen_config.cmi http_lexer.cmo http_headers.cmi framepp.cmi \ - ocsigen_http_com.cmi + ../baselib/ocsigen_config.cmi ../baselib/ocsigen_buffer_pool.cmi \ + http_lexer.cmo http_headers.cmi framepp.cmi ocsigen_http_com.cmi ocsigen_http_com.cmx : ../baselib/ocsigen_stream.cmx \ ../baselib/ocsigen_lib.cmx ocsigen_http_frame.cmx ocsigen_cookies.cmx \ - ../baselib/ocsigen_config.cmx http_lexer.cmx http_headers.cmx framepp.cmx \ - ocsigen_http_com.cmi + ../baselib/ocsigen_config.cmx ../baselib/ocsigen_buffer_pool.cmx \ + http_lexer.cmx http_headers.cmx framepp.cmx ocsigen_http_com.cmi ocsigen_http_frame.cmo : ../baselib/ocsigen_stream.cmi \ ../baselib/ocsigen_lib.cmi ocsigen_cookies.cmi http_headers.cmi \ ocsigen_http_frame.cmi diff --git a/src/http/ocsigen_http_com.ml b/src/http/ocsigen_http_com.ml index d64e760e2..fbea3c501 100644 --- a/src/http/ocsigen_http_com.ml +++ b/src/http/ocsigen_http_com.ml @@ -122,14 +122,19 @@ let create_receiver timeout mode fd = let timeout = Lwt_timeout.create timeout - (fun () -> Lwt_ssl.abort fd Timeout) - in + (fun () -> Lwt_ssl.abort fd Timeout) in + let buffer, release = Ocsigen_buffer_pool.get_lwt_bytes buffer_size in + let buf, release2 = Ocsigen_buffer_pool.get_bytes buffer_size in { id = new_id (); fd = fd; chan = Lwt_io.make ~mode:Lwt_io.output - ~buffer:(Lwt_bytes.create buffer_size) + ~close:(fun () -> Lwt_timeout.stop timeout; + release (); + release2 (); + Lwt.return_unit) + ~buffer (fun buf pos len -> Lwt_timeout.start timeout; Lwt.try_bind @@ -139,7 +144,7 @@ let create_receiver timeout mode fd = Lwt.fail (convert_io_error e))); timeout = timeout; r_mode = mode; - buf=Bytes.create buffer_size; + buf; read_pos = 0; write_pos = 0; closed = Lwt.wait (); @@ -156,7 +161,21 @@ let unlock_receiver receiver = Lwt_mutex.unlock receiver.read_mutex let abort conn = Lwt.wakeup (snd conn.closed) (); - Lwt_ssl.abort conn.fd Aborted + Lwt_ssl.abort conn.fd Aborted; + (* we discard the receive buffer so as to avoid errors in [receive] and such *) + conn.read_pos <- 0; + conn.write_pos <- 0; + (* so that we don't overwrite the buffer we no longer own by accident *) + conn.buf <- Bytes.create 8; + ignore (try Lwt_io.close conn.chan with _ -> Lwt.return_unit) + +let discard conn = + (* we discard the receive buffer so as to avoid errors in [receive] and such *) + conn.read_pos <- 0; + conn.write_pos <- 0; + (* so that we don't overwrite the buffer we no longer own by accident *) + conn.buf <- Bytes.create 8; + ignore (try Lwt_io.close conn.chan with _ -> Lwt.return_unit) let closed conn = fst conn.closed @@ -651,7 +670,7 @@ let default_sender = create_sender ~server_name:Ocsigen_config.server_name () let write_stream_chunked out_ch stream = let buf_size = 4096 in let size_for_not_buffering = 900 in - let buffer = Bytes.create buf_size in + let buffer, release = Ocsigen_buffer_pool.get_bytes buf_size in let rec aux stream len = Ocsigen_stream.next stream >>= fun e -> match e with @@ -664,7 +683,9 @@ let write_stream_chunked out_ch stream = Lwt_io.write out_ch "\r\n" end else Lwt.return ()) >>= fun () -> - Lwt_io.write out_ch "0\r\n\r\n" + Lwt_io.write out_ch "0\r\n\r\n" >>= fun () -> + release (); + Lwt.return_unit | Ocsigen_stream.Cont (s, next) -> let l = String.length s in if l = 0 then diff --git a/src/http/ocsigen_http_com.mli b/src/http/ocsigen_http_com.mli index 4d29f2f1f..697bc9fd3 100644 --- a/src/http/ocsigen_http_com.mli +++ b/src/http/ocsigen_http_com.mli @@ -102,6 +102,7 @@ val send : unit Lwt.t val abort : connection -> unit +val discard : connection -> unit (** Use this function to make an action just before sending the result diff --git a/src/server/ocsigen_server.ml b/src/server/ocsigen_server.ml index f178761c0..8c58b33e6 100644 --- a/src/server/ocsigen_server.ml +++ b/src/server/ocsigen_server.ml @@ -936,7 +936,9 @@ let handle_connection port in_ch sockaddr = ) in (* body of handle_connection *) - handle_request () + Lwt.finalize + handle_request + (fun () -> return (Ocsigen_http_com.discard receiver)) let rec wait_connection use_ssl port socket = let handle_exn e = From 62d4b86af51cf048edf7ecf07c62868d26c00c9d Mon Sep 17 00:00:00 2001 From: Mauricio Fernandez Date: Sun, 16 Aug 2015 22:21:02 +0200 Subject: [PATCH 5/7] Ocsigen_senders.File_content: avoid allocation of last chunk. --- src/http/ocsigen_senders.ml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/http/ocsigen_senders.ml b/src/http/ocsigen_senders.ml index 3d6d8cafe..c24e11f27 100644 --- a/src/http/ocsigen_senders.ml +++ b/src/http/ocsigen_senders.ml @@ -241,9 +241,31 @@ struct end else begin if read = buffer_size then Ocsigen_stream.cont buf read_aux - else Ocsigen_stream.cont (String.sub buf 0 read) read_aux + else begin + let rec return_fragment release_prev off size remaining () = + release_prev (); + if remaining = 0 then begin + release (); + Ocsigen_stream.empty None + end else if remaining <= 128 then begin + Ocsigen_stream.cont (Bytes.sub buf off remaining) + (return_fragment (fun () -> ()) (off + size) (size / 2) 0) + end else if remaining >= size then begin + (* size should be a power of two, but we take no chances here *) + let next_buf, release_next = Ocsigen_buffer_pool.get_bytes_exact size in + Bytes.blit buf off next_buf 0 size; + Ocsigen_stream.cont next_buf + (return_fragment release_next + (off + size) (size / 2) (remaining - size)) + end else begin + return_fragment (fun () -> ()) off (size / 2) remaining () + end + in + return_fragment (fun () -> ()) 0 (buffer_size / 2) read () + end end - in read_aux + in + read_aux let get_etag_aux st = Some (Printf.sprintf "%Lx-%x-%f" st.Unix.LargeFile.st_size From cfc8117dbf65be6db01f474e5f53cc6dcb1f6763 Mon Sep 17 00:00:00 2001 From: Mauricio Fernandez Date: Sun, 16 Aug 2015 23:36:28 +0200 Subject: [PATCH 6/7] Fix typo in Ocsigen_buffer_pool interface docs. --- src/baselib/ocsigen_buffer_pool.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/baselib/ocsigen_buffer_pool.mli b/src/baselib/ocsigen_buffer_pool.mli index 3856f8db9..b57205ce2 100644 --- a/src/baselib/ocsigen_buffer_pool.mli +++ b/src/baselib/ocsigen_buffer_pool.mli @@ -34,7 +34,7 @@ * * [make_buffer_pool] is used as follows: * - * {| + * {[ * let `Round_up get_buf, `Exact get_buf_exact = * make_buffer_pool ?min_size ?max_size allocate_buffer * (fun n -> how_many_buffers_to_keep_at_most n) From cb960ae7e11182ed0071f70375aff10c4671f9ba Mon Sep 17 00:00:00 2001 From: Mauricio Fernandez Date: Mon, 17 Aug 2015 15:57:27 +0200 Subject: [PATCH 7/7] Do not expose Ocsigen_buffer_pool. --- src/Makefile.filelist | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Makefile.filelist b/src/Makefile.filelist index 0b010af64..2d08c2abc 100644 --- a/src/Makefile.filelist +++ b/src/Makefile.filelist @@ -2,7 +2,6 @@ BIN := server/${PROJECTNAME} NATBIN := server/${PROJECTNAME}.opt INTF := baselib/ocsigen_cache.cmi \ - baselib/ocsigen_buffer_pool.cmi \ baselib/ocsigen_lib_base.cmi \ baselib/ocsigen_lib.cmi \ baselib/ocsigen_config.cmi \