Skip to content

Commit a91d528

Browse files
authored
Merge pull request #4921 from cornishon/fmt_allocator_docs
Update `fmt` docs for procedures with a default allocator parameter
2 parents d011cb8 + 7866f7a commit a91d528

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

core/fmt/fmt.odin

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,12 @@ register_user_formatter :: proc(id: typeid, formatter: User_Formatter) -> Regist
116116
}
117117
// Creates a formatted string
118118
//
119-
// *Allocates Using Context's Allocator*
119+
// *Allocates Using Provided Allocator*
120120
//
121121
// Inputs:
122122
// - args: A variadic list of arguments to be formatted.
123123
// - sep: An optional separator string (default is a single space).
124+
// - allocator: (default: context.allocator)
124125
//
125126
// Returns: A formatted string.
126127
//
@@ -132,11 +133,12 @@ aprint :: proc(args: ..any, sep := " ", allocator := context.allocator) -> strin
132133
}
133134
// Creates a formatted string with a newline character at the end
134135
//
135-
// *Allocates Using Context's Allocator*
136+
// *Allocates Using Provided Allocator*
136137
//
137138
// Inputs:
138139
// - args: A variadic list of arguments to be formatted.
139140
// - sep: An optional separator string (default is a single space).
141+
// - allocator: (default: context.allocator)
140142
//
141143
// Returns: A formatted string with a newline character at the end.
142144
//
@@ -148,11 +150,12 @@ aprintln :: proc(args: ..any, sep := " ", allocator := context.allocator) -> str
148150
}
149151
// Creates a formatted string using a format string and arguments
150152
//
151-
// *Allocates Using Context's Allocator*
153+
// *Allocates Using Provided Allocator*
152154
//
153155
// Inputs:
154156
// - fmt: A format string with placeholders for the provided arguments.
155157
// - args: A variadic list of arguments to be formatted.
158+
// - allocator: (default: context.allocator)
156159
// - newline: Whether the string should end with a newline. (See `aprintfln`.)
157160
//
158161
// Returns: A formatted string. The returned string must be freed accordingly.
@@ -165,11 +168,12 @@ aprintf :: proc(fmt: string, args: ..any, allocator := context.allocator, newlin
165168
}
166169
// Creates a formatted string using a format string and arguments, followed by a newline.
167170
//
168-
// *Allocates Using Context's Allocator*
171+
// *Allocates Using Provided Allocator*
169172
//
170173
// Inputs:
171174
// - fmt: A format string with placeholders for the provided arguments.
172175
// - args: A variadic list of arguments to be formatted.
176+
// - allocator: (default: context.allocator)
173177
//
174178
// Returns: A formatted string. The returned string must be freed accordingly.
175179
//
@@ -359,11 +363,12 @@ panicf :: proc(fmt: string, args: ..any, loc := #caller_location) -> ! {
359363

360364
// Creates a formatted C string
361365
//
362-
// *Allocates Using Context's Allocator*
366+
// *Allocates Using Provided Allocator*
363367
//
364368
// Inputs:
365369
// - args: A variadic list of arguments to be formatted.
366370
// - sep: An optional separator string (default is a single space).
371+
// - allocator: (default: context.allocator)
367372
//
368373
// Returns: A formatted C string.
369374
//
@@ -379,11 +384,12 @@ caprint :: proc(args: ..any, sep := " ", allocator := context.allocator) -> cstr
379384

380385
// Creates a formatted C string
381386
//
382-
// *Allocates Using Context's Allocator*
387+
// *Allocates Using Provided Allocator*
383388
//
384389
// Inputs:
385390
// - format: A format string with placeholders for the provided arguments
386391
// - args: A variadic list of arguments to be formatted
392+
// - allocator: (default: context.allocator)
387393
// - newline: Whether the string should end with a newline. (See `caprintfln`.)
388394
//
389395
// Returns: A formatted C string
@@ -399,11 +405,12 @@ caprintf :: proc(format: string, args: ..any, allocator := context.allocator, ne
399405
}
400406
// Creates a formatted C string, followed by a newline.
401407
//
402-
// *Allocates Using Context's Allocator*
408+
// *Allocates Using Provided Allocator*
403409
//
404410
// Inputs:
405411
// - format: A format string with placeholders for the provided arguments
406412
// - args: A variadic list of arguments to be formatted
413+
// - allocator: (default: context.allocator)
407414
//
408415
// Returns: A formatted C string
409416
//

0 commit comments

Comments
 (0)