Repository navigation
Welcome to OCodejs Discussions! #1
Replies: 3 comments
|
Karchnu {Computer science, Anarchy, Cats} Posted on November 21, 2020 I use Crystal intensively for my work, and I love the language. Simple, concise, it’s almost no bullshit whatsoever. But, I do have a very specific use of it: I make calls to a C library I’ve written. It is clearly not something a lot of people are doing, at least not directly, the crystal standard library is quite extensive. I trust the Crystal compiler enough to get the memory stuff done, but I may have done a terrible job in the C library and I want to check. Also, I think that valgrind is a useful tool to prevent memory errors, like corruption or leaks, and should be used intensively. Unfortunately, I cannot just use valgrind to check for memory leaks inside my C library. When I do that, there are way too many errors. Just a single example: ==21822== 25 errors in context 12 of 15: Goal: focus on my code A lot of warnings aren’t related to my code, valgrind has to ignore most of the warnings. How To In order: ask valgrind to generate suppression code with --gen-suppressions=all Each time valgrind encounters an error, it can produce a code snippet. Here is a minimal example: We start valgrind with '--gen-suppressions=all' to produce suppression code.$ valgrind --gen-suppressions=all --leak-check=full -v ./my-application Just using the code produced as-is is almost useless. This code is way too specific, and chances are that the warnings you want to suppress are related to a particular library, an object file, or to a set of functions with well-formatted names. Suppression Code Simplification To get things right, the code has to be more generic. Wildcards: *, ? and … As we can see, the suppression code produced by valgrind will suppress warnings for a kind of memory problem and a specific function stack. To make the code more generic, wildcards can be used to match functions (fun) or object files (obj). Example: This will suppress warnings for this specific stack but the last function on the stackcould be any function with a name starting with GC_{ I don’t want to specify the whole stack. The wildcard “…” should be used. This will suppress warnings for any function with a name starting with GC_regardless of the function stack.This wildcard is combined with fun or obj selectors (and other wildcards).{ This will suppress warnings for any function in object files /usr/lib/blah*{ Take your time. Be sure you don’t suppress useful warnings. Use valgrind with our suppression file Our suppression code is written in a file, named my-application.suppr for the example. valgrind, only with warnings for our code.$ valgrind --suppressions=my-application.suppr --leak-check=full -v ./my-application This blog post was heavily inspired by this page. Finally, my file to suppress Crystal’s Garbage Collector warnings { { { { |
|
Configure this repository to deploy on Vercel as a project with multiple services. Here is a suggested {
"$schema": "https://openapi.vercel.sh/vercel.json",
"services": {
"app": {
"root": ".",
"framework": "jekyll"
},
"cloud-agent": {
"root": "apps/cloud-agent",
"framework": "nextjs"
},
"core": {
"root": "framework/packages/core",
"runtime": "node"
}
},
"rewrites": [
{
"source": "/(.*)",
"destination": {
"service": "app"
}
}
]
}How Vercel services workServices let one repository deploy multiple backends and frontends as a single Vercel project, with shared routing, environment variables, and one domain. Each service is built independently, and at request time Vercel routes to a service based on the top-level rewrites.
Docs: https://vercel.com/docs/services What I need you to do
|
|
Biome has added support for markdown formatting with version 2.6 |
Uh oh!
There was an error while loading. Please reload this page.
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
All reactions